package routers

import (
	"TTSX_beego/controllers"
	"github.com/astaxie/beego"
)

func User() {
	beego.Router("/register", &controllers.UserController{}, "get:ShowReg;post:HandleReg")
	beego.Router("/login", &controllers.UserController{}, "get:ShowLogin;post:HandleLog")
	beego.Router("/active", &controllers.UserController{}, "get:ActiveUser")
	beego.Router("/user/logout", &controllers.UserController{}, "get:LogOut")
	beego.Router("/user/UserInfo", &controllers.UserController{}, "get:UserInfo")
	beego.Router("/user/UserOrder", &controllers.UserController{}, "get:UserOrder")
	beego.Router("/user/UserSite", &controllers.UserController{},
		"get:UserSite;post:HandleUserSite")
}

func Goods() {
	beego.Router("/", &controllers.GoodsController{}, "get:ShowIndex")
	beego.Router("/goodsDetail", &controllers.GoodsController{}, "get:ShowDetail")
	beego.Router("/goodsList", &controllers.GoodsController{}, "get:ShowList")
	beego.Router("/goodsSearch", &controllers.GoodsController{}, "post:HandleSearch")
	beego.Router("/cart/addCart", &controllers.CartController{}, "post:HandleAddCart")
}

func Admin() {
	beego.Router("/admin/index", &controllers.AdminController{}, "get:ShowIndex")
	beego.Router("/admin/addType", &controllers.AdminController{},
		"get:ShowAddType;post:HandleAddType")
	beego.Router("/admin", &controllers.AdminController{}, "get:MoveAdmin")
	beego.Router("/Admin/login", &controllers.AdminController{},
		"get:ShowAdminLogin;post:HandleAdminLogin")

	beego.Router("/admin/AddGoodsSPU", &controllers.AdminController{},
		"get:ShowAddSPU;post:HandleAddSPU")
	beego.Router("/admin/AddGoods", &controllers.AdminController{},
		"get:ShowAddGoods;post:HandleAddGoods")

}
